package com.itcs.se.security.service;

import java.util.Collection;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.etc.framework.orm.Condition;
import com.etc.framework.orm.Order;
import com.etc.framework.orm.Pager;
import com.etc.framework.orm.PagerRecords;
import com.itcs.se.security.dao.SeReleaseDao;
import com.itcs.se.security.domain.SeRelease;

/**
 * @ClassName: SeReleaseService
 * @Description:TODO(这里用一句话描述这个类的作用)
 * @author: CHEN-HF
 * @date: 2018年10月30日 下午3:56:03
 * 
 * @Copyright: 2018 Inc. All rights reserved. 注意：本内容仅限于内部传阅，禁止外泄以及用于其他的商业目
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class SeReleaseService {

	@Autowired
	private SeReleaseDao seReleaseDao;

	/*
	 * 分页查询信息
	 */
	public PagerRecords getSeReleasePager(Pager pager, Collection<Condition> conditions, Collection<Order> orders) {
		return seReleaseDao.findByPager(pager, conditions, orders);
	}

	public List<SeRelease> getSeRelease(Collection<Condition> conditions, Collection<Order> orders) {
		return seReleaseDao.commonQuery(conditions, orders);
	}

	/*
	 * 保存或修改信息
	 */
	public SeRelease saveOrUpdateSeRelease(SeRelease o) {
		return (SeRelease) seReleaseDao.save(o);
	}

	/*
	 * 删除信息
	 */
	public void deleteSeRelease(String id) {
		seReleaseDao.delete(id);
	}

	/*
	 * 根据主键查询
	 */
	public SeRelease getSeRelease(String id) {
		return (SeRelease) seReleaseDao.findOne(id);
	}

	public SeRelease getSeReleaseWithOne(String[] properties, Object[] values) {
		return (SeRelease) seReleaseDao.findFirstByProperties(properties, values);
	}
}
